<template>
  <div id="shenQing" ref="shenQing">
    <ul>
      <li v-show="contentData.length > 0" v-for="(item, index) in contentData" @click="handle(item)" :key="index">
        <p style="font-weight: bold; height: 30px">
          <span style="float: left">{{ item.NODE_NAME }}</span>
          <span style="float: right">{{ item.HOUSEAPPLICANT }}</span>
        </p>
        <p style="font-size: 14px; color: #848484; height: 30px">
          <span style="float: left">进度：{{ item.PROC_NAME }}</span>
          <span style="float: right">{{ item.APPLYTIME }}</span>
        </p>
        <p style="font-size: 14px; color: #848484; height: 30px">
          <span style="float: left">地址：{{ item.PERMANENTADDR?item.PERMANENTADDR:'暂无数据' }}</span>
        </p>
      </li>
      <div style="height: 60vh;text-align:center;padding-top: 20vh;" v-show="contentData.length == 0">
        <div style="margin-bottom: 10px;">
          <img src="https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/DSF/50.png">
        </div>
        <div>暂无数据</div>
      </div>
    </ul>
  </div>
</template>
<script>
import { QuerySignCallback } from "../../utils/api";
import BScroll from 'better-scroll'
export default {
  data () {
    return {
      contentData: []
    }
  },
  methods: {
    getdata: async function () {
      let params2 = {
	    "accessCode": "688bd3883572440a859dfd8ba9194e7b",
	    "cityCode": window.localStorage.getItem('citycode') ? window.localStorage.getItem('citycode') : '',
	    "params": {
		    dataguid: "01f654f5-f280-474a-957f-d1d556840357",
        searchObject: [],
        bizGuid: "d718f2a6-6d0a-42d2-9f03-e396fd056b79",
        token: window.localStorage.getItem("token"),
	      }
      }
      var res1 = await QuerySignCallback(params2);
      this.contentData = eval("("+res1.data.data+")").Data;
      this.$store.commit('getContent', this.contentData)
      this.$nextTick(() => {
        this.scroll = new BScroll(this.$refs.shenQing, {
          click:true
        })
      })
    },
    handle (data) {
      if (data.PROC_GUID) {
        this.$router.push({
          path: "/KeyLine",
          query: { PROC_GUID: data.PROC_GUID }
        });
      } else {
        this.$toast.fail('暂无环节信息');
        // this.$notify({ type: 'warning', message: '暂无环节信息' });
      }
    }
  },
  mounted () {
    if (this.$store.state.dataContent.length == 0) {
      this.getdata();
    } else {
      this.contentData = this.$store.state.dataContent
    }
    if (ZWJSBridge) {
      ZWJSBridge.setTitle({
        title: "申请记录",
      })
        .then((res) => {
          console.log(res);
        })
        .catch((err) => {
          console.log(err);
        });
    }
  }
}
</script>
<style lang='scss' scoped>
#shenQing {
  height: 88vh;
  overflow: hidden;
  // font-family: "Helvetica Neue", Helvetica, STHeiTi, sans-serif;
  ul li {
    padding: 10px;
    height: 90px;
    border-bottom: 1px solid #d2d2d2;
    margin-bottom: 10px;
    padding-top: 4px;
      // border-bottom: 1px solid #d2d2d2;
       background-color: white;
      // margin: 14px 10px;
      border-radius: 10px;
      padding: 10px;
      width: 96%;
      margin: 0 auto;
      margin-top: 4px;
      color: black;
      box-shadow: 0 0 12px #e3e3e3;
  }
}
</style>
